#include "main/utils.h"
using namespace std;

class Solution {
  public:
    void moveZeroes(vector<int>& nums) {
      int zero_idx = 0;
      int len = nums.size();
      for (int i = 0; i < len; ++i) {
        if (nums[i] == 0) {
          continue;
        }
        nums[zero_idx++] = nums[i];
      }
      while (zero_idx < len) {
        nums[zero_idx++] = 0;
      }
    }
    void moveZeroes1(vector<int>& nums) {
      int len = nums.size();
      for (int left = 0, right = 0; right < len; ++right) {
        if (nums[right]) {
          swap(nums[left], nums[right]);
          left++;
        }
      }
    }
};

int main() {
  vector<int> input = {0, 1, 0, 3, 12};
  Solution su;
  su.moveZeroes(input);
  printVec("output", input);
  vector<int> input1 = {0, 1, 0, 3, 12, 0};
  su.moveZeroes1(input1);
  printVec("output1", input1);
}
